package com.dz.Service;

import com.dz.dao.BookMapper;
import com.dz.pojo.Books;

import java.util.List;

public class BooksServiceImpl implements BookService {
    //业务层调Dao层
    private BookMapper bookMapper;

    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    public int addBook(Books books) {
        return bookMapper.addBook(books);
    }

    public int deleteBookById(String id) {
        return bookMapper.deleteBookById(id);
    }

    public int updataBook(Books books) {
        return bookMapper.updataBook(books);
    }

    public Books queryBook(String id) {
        return bookMapper.queryBook(id);
    }

    public  List<Books> queryAllBooks() {
        return bookMapper.queryAllBooks();
    }

    @Override
    public Books queryBookByName(String BookName) {
        return bookMapper.queryBookByName(BookName);
    }
}
